Integrand size = 24, antiderivative size = 672 \[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^2} \, dx=\frac {2 a e \sqrt {g} \arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right )}{\sqrt {f}}-\frac {i b e \sqrt {g} \log (1+i c x) \log \left (\frac {c \left (\sqrt {-f}-\sqrt {g} x\right )}{c \sqrt {-f}-i \sqrt {g}}\right )}{2 \sqrt {-f}}+\frac {i b e \sqrt {g} \log (1-i c x) \log \left (\frac {c \left (\sqrt {-f}-\sqrt {g} x\right )}{c \sqrt {-f}+i \sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {i b e \sqrt {g} \log (1-i c x) \log \left (\frac {c \left (\sqrt {-f}+\sqrt {g} x\right )}{c \sqrt {-f}-i \sqrt {g}}\right )}{2 \sqrt {-f}}+\frac {i b e \sqrt {g} \log (1+i c x) \log \left (\frac {c \left (\sqrt {-f}+\sqrt {g} x\right )}{c \sqrt {-f}+i \sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x}+\frac {1}{2} b c \log \left (-\frac {g x^2}{f}\right ) \left (d+e \log \left (f+g x^2\right )\right )-\frac {1}{2} b c \log \left (-\frac {g \left (1+c^2 x^2\right )}{c^2 f-g}\right ) \left (d+e \log \left (f+g x^2\right )\right )+\frac {i b e \sqrt {g} \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (i-c x)}{c \sqrt {-f}+i \sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {i b e \sqrt {g} \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (1-i c x)}{i c \sqrt {-f}+\sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {i b e \sqrt {g} \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (1+i c x)}{i c \sqrt {-f}+\sqrt {g}}\right )}{2 \sqrt {-f}}+\frac {i b e \sqrt {g} \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (i+c x)}{c \sqrt {-f}+i \sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {1}{2} b c e \operatorname {PolyLog}\left (2,\frac {c^2 \left (f+g x^2\right )}{c^2 f-g}\right )+\frac {1}{2} b c e \operatorname {PolyLog}\left (2,1+\frac {g x^2}{f}\right ) \]
[Out]
Time = 0.48 (sec) , antiderivative size = 672, normalized size of antiderivative = 1.00, number of steps used = 28, number of rules used = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.583, Rules used = {5137, 2525, 36, 29, 31, 2463, 2441, 2352, 2440, 2438, 5030, 211, 5028, 2456} \[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^2} \, dx=-\frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x}+\frac {2 a e \sqrt {g} \arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right )}{\sqrt {f}}-\frac {1}{2} b c \log \left (-\frac {g \left (c^2 x^2+1\right )}{c^2 f-g}\right ) \left (d+e \log \left (f+g x^2\right )\right )-\frac {1}{2} b c e \operatorname {PolyLog}\left (2,\frac {c^2 \left (g x^2+f\right )}{c^2 f-g}\right )+\frac {1}{2} b c \log \left (-\frac {g x^2}{f}\right ) \left (d+e \log \left (f+g x^2\right )\right )+\frac {1}{2} b c e \operatorname {PolyLog}\left (2,\frac {g x^2}{f}+1\right )+\frac {i b e \sqrt {g} \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (i-c x)}{\sqrt {-f} c+i \sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {i b e \sqrt {g} \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (1-i c x)}{i \sqrt {-f} c+\sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {i b e \sqrt {g} \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (i c x+1)}{i \sqrt {-f} c+\sqrt {g}}\right )}{2 \sqrt {-f}}+\frac {i b e \sqrt {g} \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (c x+i)}{\sqrt {-f} c+i \sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {i b e \sqrt {g} \log (1+i c x) \log \left (\frac {c \left (\sqrt {-f}-\sqrt {g} x\right )}{c \sqrt {-f}-i \sqrt {g}}\right )}{2 \sqrt {-f}}+\frac {i b e \sqrt {g} \log (1-i c x) \log \left (\frac {c \left (\sqrt {-f}-\sqrt {g} x\right )}{c \sqrt {-f}+i \sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {i b e \sqrt {g} \log (1-i c x) \log \left (\frac {c \left (\sqrt {-f}+\sqrt {g} x\right )}{c \sqrt {-f}-i \sqrt {g}}\right )}{2 \sqrt {-f}}+\frac {i b e \sqrt {g} \log (1+i c x) \log \left (\frac {c \left (\sqrt {-f}+\sqrt {g} x\right )}{c \sqrt {-f}+i \sqrt {g}}\right )}{2 \sqrt {-f}} \]
[In]
[Out]
Rule 29
Rule 31
Rule 36
Rule 211
Rule 2352
Rule 2438
Rule 2440
Rule 2441
Rule 2456
Rule 2463
Rule 2525
Rule 5028
Rule 5030
Rule 5137
Rubi steps \begin{align*} \text {integral}& = -\frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x}+(b c) \int \frac {d+e \log \left (f+g x^2\right )}{x \left (1+c^2 x^2\right )} \, dx+(2 e g) \int \frac {a+b \arctan (c x)}{f+g x^2} \, dx \\ & = -\frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x}+\frac {1}{2} (b c) \text {Subst}\left (\int \frac {d+e \log (f+g x)}{x \left (1+c^2 x\right )} \, dx,x,x^2\right )+(2 a e g) \int \frac {1}{f+g x^2} \, dx+(2 b e g) \int \frac {\arctan (c x)}{f+g x^2} \, dx \\ & = \frac {2 a e \sqrt {g} \arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right )}{\sqrt {f}}-\frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x}+\frac {1}{2} (b c) \text {Subst}\left (\int \left (\frac {d+e \log (f+g x)}{x}-\frac {c^2 (d+e \log (f+g x))}{1+c^2 x}\right ) \, dx,x,x^2\right )+(i b e g) \int \frac {\log (1-i c x)}{f+g x^2} \, dx-(i b e g) \int \frac {\log (1+i c x)}{f+g x^2} \, dx \\ & = \frac {2 a e \sqrt {g} \arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right )}{\sqrt {f}}-\frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x}+\frac {1}{2} (b c) \text {Subst}\left (\int \frac {d+e \log (f+g x)}{x} \, dx,x,x^2\right )-\frac {1}{2} \left (b c^3\right ) \text {Subst}\left (\int \frac {d+e \log (f+g x)}{1+c^2 x} \, dx,x,x^2\right )+(i b e g) \int \left (\frac {\sqrt {-f} \log (1-i c x)}{2 f \left (\sqrt {-f}-\sqrt {g} x\right )}+\frac {\sqrt {-f} \log (1-i c x)}{2 f \left (\sqrt {-f}+\sqrt {g} x\right )}\right ) \, dx-(i b e g) \int \left (\frac {\sqrt {-f} \log (1+i c x)}{2 f \left (\sqrt {-f}-\sqrt {g} x\right )}+\frac {\sqrt {-f} \log (1+i c x)}{2 f \left (\sqrt {-f}+\sqrt {g} x\right )}\right ) \, dx \\ & = \frac {2 a e \sqrt {g} \arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right )}{\sqrt {f}}-\frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x}+\frac {1}{2} b c \log \left (-\frac {g x^2}{f}\right ) \left (d+e \log \left (f+g x^2\right )\right )-\frac {1}{2} b c \log \left (-\frac {g \left (1+c^2 x^2\right )}{c^2 f-g}\right ) \left (d+e \log \left (f+g x^2\right )\right )-\frac {1}{2} (b c e g) \text {Subst}\left (\int \frac {\log \left (-\frac {g x}{f}\right )}{f+g x} \, dx,x,x^2\right )+\frac {1}{2} (b c e g) \text {Subst}\left (\int \frac {\log \left (\frac {g \left (1+c^2 x\right )}{-c^2 f+g}\right )}{f+g x} \, dx,x,x^2\right )-\frac {(i b e g) \int \frac {\log (1-i c x)}{\sqrt {-f}-\sqrt {g} x} \, dx}{2 \sqrt {-f}}-\frac {(i b e g) \int \frac {\log (1-i c x)}{\sqrt {-f}+\sqrt {g} x} \, dx}{2 \sqrt {-f}}+\frac {(i b e g) \int \frac {\log (1+i c x)}{\sqrt {-f}-\sqrt {g} x} \, dx}{2 \sqrt {-f}}+\frac {(i b e g) \int \frac {\log (1+i c x)}{\sqrt {-f}+\sqrt {g} x} \, dx}{2 \sqrt {-f}} \\ & = \frac {2 a e \sqrt {g} \arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right )}{\sqrt {f}}-\frac {i b e \sqrt {g} \log (1+i c x) \log \left (\frac {c \left (\sqrt {-f}-\sqrt {g} x\right )}{c \sqrt {-f}-i \sqrt {g}}\right )}{2 \sqrt {-f}}+\frac {i b e \sqrt {g} \log (1-i c x) \log \left (\frac {c \left (\sqrt {-f}-\sqrt {g} x\right )}{c \sqrt {-f}+i \sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {i b e \sqrt {g} \log (1-i c x) \log \left (\frac {c \left (\sqrt {-f}+\sqrt {g} x\right )}{c \sqrt {-f}-i \sqrt {g}}\right )}{2 \sqrt {-f}}+\frac {i b e \sqrt {g} \log (1+i c x) \log \left (\frac {c \left (\sqrt {-f}+\sqrt {g} x\right )}{c \sqrt {-f}+i \sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x}+\frac {1}{2} b c \log \left (-\frac {g x^2}{f}\right ) \left (d+e \log \left (f+g x^2\right )\right )-\frac {1}{2} b c \log \left (-\frac {g \left (1+c^2 x^2\right )}{c^2 f-g}\right ) \left (d+e \log \left (f+g x^2\right )\right )+\frac {1}{2} b c e \operatorname {PolyLog}\left (2,1+\frac {g x^2}{f}\right )+\frac {1}{2} (b c e) \text {Subst}\left (\int \frac {\log \left (1+\frac {c^2 x}{-c^2 f+g}\right )}{x} \, dx,x,f+g x^2\right )-\frac {\left (b c e \sqrt {g}\right ) \int \frac {\log \left (-\frac {i c \left (\sqrt {-f}-\sqrt {g} x\right )}{-i c \sqrt {-f}+\sqrt {g}}\right )}{1-i c x} \, dx}{2 \sqrt {-f}}-\frac {\left (b c e \sqrt {g}\right ) \int \frac {\log \left (\frac {i c \left (\sqrt {-f}-\sqrt {g} x\right )}{i c \sqrt {-f}+\sqrt {g}}\right )}{1+i c x} \, dx}{2 \sqrt {-f}}+\frac {\left (b c e \sqrt {g}\right ) \int \frac {\log \left (-\frac {i c \left (\sqrt {-f}+\sqrt {g} x\right )}{-i c \sqrt {-f}-\sqrt {g}}\right )}{1-i c x} \, dx}{2 \sqrt {-f}}+\frac {\left (b c e \sqrt {g}\right ) \int \frac {\log \left (\frac {i c \left (\sqrt {-f}+\sqrt {g} x\right )}{i c \sqrt {-f}-\sqrt {g}}\right )}{1+i c x} \, dx}{2 \sqrt {-f}} \\ & = \frac {2 a e \sqrt {g} \arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right )}{\sqrt {f}}-\frac {i b e \sqrt {g} \log (1+i c x) \log \left (\frac {c \left (\sqrt {-f}-\sqrt {g} x\right )}{c \sqrt {-f}-i \sqrt {g}}\right )}{2 \sqrt {-f}}+\frac {i b e \sqrt {g} \log (1-i c x) \log \left (\frac {c \left (\sqrt {-f}-\sqrt {g} x\right )}{c \sqrt {-f}+i \sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {i b e \sqrt {g} \log (1-i c x) \log \left (\frac {c \left (\sqrt {-f}+\sqrt {g} x\right )}{c \sqrt {-f}-i \sqrt {g}}\right )}{2 \sqrt {-f}}+\frac {i b e \sqrt {g} \log (1+i c x) \log \left (\frac {c \left (\sqrt {-f}+\sqrt {g} x\right )}{c \sqrt {-f}+i \sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x}+\frac {1}{2} b c \log \left (-\frac {g x^2}{f}\right ) \left (d+e \log \left (f+g x^2\right )\right )-\frac {1}{2} b c \log \left (-\frac {g \left (1+c^2 x^2\right )}{c^2 f-g}\right ) \left (d+e \log \left (f+g x^2\right )\right )-\frac {1}{2} b c e \operatorname {PolyLog}\left (2,\frac {c^2 \left (f+g x^2\right )}{c^2 f-g}\right )+\frac {1}{2} b c e \operatorname {PolyLog}\left (2,1+\frac {g x^2}{f}\right )+\frac {\left (i b e \sqrt {g}\right ) \text {Subst}\left (\int \frac {\log \left (1+\frac {\sqrt {g} x}{-i c \sqrt {-f}-\sqrt {g}}\right )}{x} \, dx,x,1-i c x\right )}{2 \sqrt {-f}}-\frac {\left (i b e \sqrt {g}\right ) \text {Subst}\left (\int \frac {\log \left (1+\frac {\sqrt {g} x}{i c \sqrt {-f}-\sqrt {g}}\right )}{x} \, dx,x,1+i c x\right )}{2 \sqrt {-f}}-\frac {\left (i b e \sqrt {g}\right ) \text {Subst}\left (\int \frac {\log \left (1-\frac {\sqrt {g} x}{-i c \sqrt {-f}+\sqrt {g}}\right )}{x} \, dx,x,1-i c x\right )}{2 \sqrt {-f}}+\frac {\left (i b e \sqrt {g}\right ) \text {Subst}\left (\int \frac {\log \left (1-\frac {\sqrt {g} x}{i c \sqrt {-f}+\sqrt {g}}\right )}{x} \, dx,x,1+i c x\right )}{2 \sqrt {-f}} \\ & = \frac {2 a e \sqrt {g} \arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right )}{\sqrt {f}}-\frac {i b e \sqrt {g} \log (1+i c x) \log \left (\frac {c \left (\sqrt {-f}-\sqrt {g} x\right )}{c \sqrt {-f}-i \sqrt {g}}\right )}{2 \sqrt {-f}}+\frac {i b e \sqrt {g} \log (1-i c x) \log \left (\frac {c \left (\sqrt {-f}-\sqrt {g} x\right )}{c \sqrt {-f}+i \sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {i b e \sqrt {g} \log (1-i c x) \log \left (\frac {c \left (\sqrt {-f}+\sqrt {g} x\right )}{c \sqrt {-f}-i \sqrt {g}}\right )}{2 \sqrt {-f}}+\frac {i b e \sqrt {g} \log (1+i c x) \log \left (\frac {c \left (\sqrt {-f}+\sqrt {g} x\right )}{c \sqrt {-f}+i \sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x}+\frac {1}{2} b c \log \left (-\frac {g x^2}{f}\right ) \left (d+e \log \left (f+g x^2\right )\right )-\frac {1}{2} b c \log \left (-\frac {g \left (1+c^2 x^2\right )}{c^2 f-g}\right ) \left (d+e \log \left (f+g x^2\right )\right )+\frac {i b e \sqrt {g} \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (i-c x)}{c \sqrt {-f}+i \sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {i b e \sqrt {g} \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (1-i c x)}{i c \sqrt {-f}+\sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {i b e \sqrt {g} \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (1+i c x)}{i c \sqrt {-f}+\sqrt {g}}\right )}{2 \sqrt {-f}}+\frac {i b e \sqrt {g} \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (i+c x)}{c \sqrt {-f}+i \sqrt {g}}\right )}{2 \sqrt {-f}}-\frac {1}{2} b c e \operatorname {PolyLog}\left (2,\frac {c^2 \left (f+g x^2\right )}{c^2 f-g}\right )+\frac {1}{2} b c e \operatorname {PolyLog}\left (2,1+\frac {g x^2}{f}\right ) \\ \end{align*}
Time = 0.81 (sec) , antiderivative size = 552, normalized size of antiderivative = 0.82 \[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^2} \, dx=\frac {1}{2} \left (-\frac {2 (a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x}+\frac {e \sqrt {g} \left (4 a \sqrt {-f} \arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right )+i b \sqrt {f} \left (\log (1+i c x) \log \left (\frac {c \left (\sqrt {-f}+\sqrt {g} x\right )}{c \sqrt {-f}+i \sqrt {g}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {g} (i-c x)}{c \sqrt {-f}+i \sqrt {g}}\right )\right )-i b \sqrt {f} \left (\log (1-i c x) \log \left (\frac {c \left (\sqrt {-f}+\sqrt {g} x\right )}{c \sqrt {-f}-i \sqrt {g}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {g} (1-i c x)}{i c \sqrt {-f}+\sqrt {g}}\right )\right )-i b \sqrt {f} \left (\log (1+i c x) \log \left (\frac {c \left (\sqrt {-f}-\sqrt {g} x\right )}{c \sqrt {-f}-i \sqrt {g}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {g} (1+i c x)}{i c \sqrt {-f}+\sqrt {g}}\right )\right )+i b \sqrt {f} \left (\log (1-i c x) \log \left (\frac {c \left (\sqrt {-f}-\sqrt {g} x\right )}{c \sqrt {-f}+i \sqrt {g}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {g} (i+c x)}{c \sqrt {-f}+i \sqrt {g}}\right )\right )\right )}{\sqrt {-f^2}}+b c \left (\left (\log \left (-\frac {g x^2}{f}\right )-\log \left (-\frac {g \left (1+c^2 x^2\right )}{c^2 f-g}\right )\right ) \left (d+e \log \left (f+g x^2\right )\right )-e \operatorname {PolyLog}\left (2,\frac {c^2 \left (f+g x^2\right )}{c^2 f-g}\right )+e \operatorname {PolyLog}\left (2,1+\frac {g x^2}{f}\right )\right )\right ) \]
[In]
[Out]
\[\int \frac {\left (a +b \arctan \left (c x \right )\right ) \left (d +e \ln \left (g \,x^{2}+f \right )\right )}{x^{2}}d x\]
[In]
[Out]
\[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^2} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )} {\left (e \log \left (g x^{2} + f\right ) + d\right )}}{x^{2}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^2} \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^2} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )} {\left (e \log \left (g x^{2} + f\right ) + d\right )}}{x^{2}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^2} \, dx=\text {Timed out} \]
[In]
[Out]
Timed out. \[ \int \frac {(a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right )}{x^2} \, dx=\int \frac {\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )\,\left (d+e\,\ln \left (g\,x^2+f\right )\right )}{x^2} \,d x \]
[In]
[Out]